package com.xzh.dao;

import com.xzh.model.search.DashboardStats;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DashboardMapper {

    /**
     * 获取学生总数
     */
    @Select("SELECT COUNT(*) FROM students")
    Integer getStudentCount();

    /**
     * 获取课程总数
     */
    @Select("SELECT COUNT(*) FROM courses")
    Integer getCourseCount();

    /**
     * 获取预约总数
     */
    @Select("SELECT COUNT(*) FROM student_appointments")
    Integer getAppointmentCount();

    /**
     * 获取平均评分
     */
    @Select("SELECT COALESCE(ROUND(AVG(rating), 1), 0.0) FROM course_reviews")
    String getAverageRating();
}
